package com.yangtao.springbootfreemarker.web.controller.sys;

import com.yangtao.core.web.ResultMsg;
import com.yangtao.springbootfreemarker.domain.sys.entity.SysMenu;
import com.yangtao.springbootfreemarker.domain.sys.service.SysMenuService;
import com.yangtao.springbootfreemarker.web.controller.common.ControllerBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("sys/sysMenu")
public class SysMenuController extends ControllerBase {

	@Autowired
	private SysMenuService sysMenuService;

	@ResponseBody
	@RequestMapping(value = "/nav")
	public ResultMsg nav() {
		 List<SysMenu> list = sysMenuService.getUserMenuList();
		// 返回成功信息
		return ResultMsg.buildSuccessMsg(list);
	}
}
